import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
    state: {
      users: {},/**用户信息 */
      nav:[],/**菜单 */
      myWarehouse:[],/**用户的仓库列表 */
      disabled:false,/**弹窗是否可点击 */
      collarUse:[],/**资产领用单 */
      collarUseOfMeterials:[],/**耗材领用单 */
      warehouseOfAssetsManager:'',/**资产管理的仓库id */
      defaultActive:'',
      qrCodeTpData:{}, //二维码模版文案信息
      badgeNumber: {},
      consumableNumber: {},
      activeIndex:0
    },
    mutations: {
      setactiveIndex(state,activeIndex) { /**设置二维码模版文案信息 */
        state.activeIndex = activeIndex
      },
      setQrCodeTpData(state,qrCodeTpData) { /**设置二维码模版文案信息 */
        state.qrCodeTpData = qrCodeTpData
      },
      changeDefaultActive(state,defaultActive) { /**保存默认高亮nav */
        state.defaultActive = defaultActive
      },
      changeUser (state,user) { /**保存用户数据 */
        state.users = user
      },
      changeNav (state,nav) { /**保存导航栏数据 */
        state.nav = nav
      },
      changeMyWarehouse (state,warehouse) { /**保存管理员的仓库 */
        state.myWarehouse = warehouse
      },
      changeDisabled (state,disabled) {/**保存弹窗的点击 */
        state.disabled = disabled
      },
      changeCollarUse (state,collarUse) { /**保存资产领用数据 */
        state.collarUse = collarUse
      },
      changeCollarUseOfMeterials (state,collarUseOfMeterials) {/**保存耗材领用数据 */
        state.collarUseOfMeterials = collarUseOfMeterials
      },
      changeWarehouse(state,value) { /**保存资产管理中的仓库数据 */
        state.warehouseOfAssetsManager = value
      },
      changeBadgeNumber(state,badgeNumber) { 
        state.badgeNumber = badgeNumber
      },
      changeConsumableNumber(state,consumableNumber){
        state.consumableNumber = consumableNumber
      }
    }
  })
  export default store